package com.log530_projetfinal;

import java.util.Vector;

import android.graphics.Point;

public class Carnivore
  extends Herbivore
{
  public Carnivore(String id, int size, int vie, boolean vivant,
                   Point coordo, int vitalite, int maturite, int age,
                   int sprint, int vitesse, int yeux, int oreille, int nez,
                   int faim, int energie, float velocity, float voracity)
  {
    super(id, /*id*/size, /*size*/vie, /*vie*/vivant, /*vivant*/coordo,
          /*point*/maturite, /*agereproduction*/vitalite, /*vitalite*/age,
          /*age*/sprint, /*sprint*/vitesse, /*vitesse*/yeux,
          /*yeux*/oreille, /*oreille*/nez, /*nez*/faim, /*faim*/energie,
          /*energie*/velocity, /*velocity*/voracity) /*voracity*/;

  }


  public void pulse()
  {
    if (vivant)
    {
      energie -= 1;
      /*bug++;
          System.out.println(bug);
          if (bug >= 292)
          {
          bug=bug;
          }*/
      if (calendrier < 12)
      {
        calendrier++;
      }
      else
      {
        age++;
        calendrier = 0;
      }
      if (!maturite)
      {
        if (age >= ageReproduction)
        {
          maturite = true;
        }
      }
      jeFaisKoi();
    }

    if (energie <= 0)
    {
      vivant = false;
    }
  }

  public void jeFaisKoi()
  {
    trouverNourriture("Manger", "Herbivore"); //je trouve a mange
  }

  public Vector<Point> spreadChild()
  {

    Vector<Point> listPoint = new Vector<Point>();

    if ((energie - 50) > 0)
    {

      for (int i = 0; i < 2; i++)
      {
        if (size > 0)
        {
          Point tempoPoint =
            utile.genPtInCircle(coordo, size * 5, super.generatorRandom);

          if (super.pointSizeInsideMap(tempoPoint, attHerbi.size))
            listPoint.add(tempoPoint);
        }
      }
      energie -= 50;
    }

    return listPoint;
  }
}
